Not really.
Perhaps a picture is needed. Clouds represent class definitions, solid rectangles represent objects, and dotted rectangles represent the static part of a class.
Look back at the example program as you study the diagram.
ButtonDemo2
extends the class JFrame
.main()
method is static, so is not part of any object.
It contains two reference variables:
buttonDemo
object, andWindowQuitter
objectButtonDemo2
frame,
which has a graphic representation on the screen.
ButtonDemo2
frame.
ButtonDemo2
frame is registered as a listener for Action Events.ButtonDemo2
class implements ActionListener
.WindowQuitter
object.
WindowQuitter
object was registered as a listener for window events.WindowQuitter
class extends WindowAdapter
.Don't be discouraged if this is less than perfectly clear! It usually takes some time to get all of these relationships straight. A bit more practice would not hurt, either.